﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;

namespace ECCSystem.DataAccess
{ 
    class ClsSaleCommodity : DBObject
    {
        public DataSet GetList()
        {
            return RunProcedure("sp_SaleCommodity_GetList", new IDataParameter[] { }, "SaleCommodity");
        }
        public void AddCommodity(string strName)
        {
            SqlParameter[] parameters = new SqlParameter[] { new SqlParameter("@Name", SqlDbType.NVarChar, 20) };
            parameters[0].Value = strName;
            this.RunProcedure("sp_SaleCommodity_Add", parameters, "SaleCommodity");
        }
        public void DeleteCommodity(long lngID)
        {
            SqlParameter[] parameters = new SqlParameter[] { new SqlParameter("@ID", SqlDbType.BigInt) };
            parameters[0].Value = lngID;
            this.RunProcedure("sp_SaleCommodity_Delete", parameters, "SaleCommodity");
        }
    }
}
